﻿using System;
using System.Data;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using System.IO;

namespace prjKQXS_UI
{
    public partial class frmDSHopDong : DevExpress.XtraEditors.XtraForm
    {
        string hopdong = "";
        //string path = "";

        public frmDSHopDong()
        {
            InitializeComponent();
        }
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            hopdong = "hopdong1";
            frmBaoCao frm = new frmBaoCao();
            frm.ShowDialog();
        }

        private void simpleButton2_Click(object sender, EventArgs e)
        {
            hopdong = "hopdong2";
            frmBaoCao frm = new frmBaoCao();
            frm.ShowDialog();
        }

        private void simpleButton3_Click(object sender, EventArgs e)
        {
            hopdong = "hopdong3";
            frmBaoCao frm = new frmBaoCao();
            frm.ShowDialog();
        }

        private void frmFormTest_Load(object sender, EventArgs e)
        {
            string file = "";
            try
            {                               
                string[] dirs = Directory.GetFiles(@"D:\HopDong");                
                foreach (string dir in dirs)
                {
                    if(dir.Contains(@"D:\HopDong"))
                    {
                        file= dir.Replace(@"D:\HopDong\","");
                    }
                    cbbFileName.Items.Add(file);
                }
                if (cbbFileName.Items.Count > 0)
                {
                    cbbFileName.SelectedIndex = 0;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

        private void btnInBC_Click(object sender, EventArgs e)
        {
            frmBaoCao frm = new frmBaoCao();
            frm.ShowDialog();
        }

        private void btnThoat_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}